package num58;

/**
 * 58. 最后一个单词的长度
 *
 * 题目： https://leetcode-cn.com/problems/length-of-last-word/
 * 三叶姐题解： https://leetcode-cn.com/problems/length-of-last-word/solution/gong-shui-san-xie-jian-dan-zi-fu-chuan-m-tt6t/
 *
 * me
 */
class Solution {
    public int lengthOfLastWord(String s) {
        String[] s1 = s.split(" ");
        String s2 = s1[s1.length - 1];
        return s2.length();
    }

    public static void main(String[] args) {
        System.out.println(new Solution().lengthOfLastWord("luffy is still joyboy"));
    }
}
